  
var orderManage1 = function() {

	var _init = function() {

		var table = $('#table_order');
		var  uperUserId=$('#userId').val();
		var tableUnit=table.dataTable({
			"processing": true,
			// 开启服务器模式
			serverSide: true,
			"ajax": {
				url:"/a/wxconf/comm/jtl",
				data:{"userId":uperUserId}  //提现
			},
			"autoWidth": true,
			"columns": [
				{
					"data": "createDate",//提现金额
					"render":function(data, type, row, meta) {
						return moment(data).format('YYYY-MM-DD HH:mm:ss');
					}
					
				},
				{
				
					"data":"instruction"//提现账户
				
				},
				{
					"data":"integral",//交易单号
					"render":function(data, type, row, meta) {
						var val="--";
						
						if(null!=data){
							if(data>0){
								return "+"+data;
							}else{
								return data;
							}
							
						}
						return val;
					}
				
				},
				{
					"data":"orderId",//交易时间,
					"render": function(data, type, row, meta) {
							var val="--";
							if( data!=null && data!=''){

								$.ajax({
									url : '/a/wxconf/comm/utl',
									type : 'post',
									dataType : 'json',
									contentType:"application/json; charset=utf-8",
									async: false,
									data : JSON.stringify({ id: data }),
								}).done(function(r) {
									if (r.status === '1') { 
										if(null != r.data){
											val=r.data.orderNO;

										} else if (r.status == '2') {

										}
									}
								});
								return val;
							}else{
								return "--";
							}
						}
					
				}
				],
				"language": {
					 "lengthMenu": "每页显示 _MENU_ 条记录",
		                "emptyTable": "暂无数据记录",
		                "info": "显示 _START_ 至 _END_ 条数据，共 _TOTAL_ 条记录！",
		                "zeroRecords": "没有搜索到匹配记录",
		                "infoEmpty": "",
		                "infoFiltered": "",
		                "processing": "数据加载中,请稍后..."
				},
				"pageLength": 10,
				"order": [
					[0, "desc"]
					],
					
					"columnDefs": [{
						"orderable": false,
						"targets": [1,2,3]
					}],
            "dom": "<'row'<'.col-md-6 col-sm-12'><'col-md-6 col-sm-12'>r>" +
            "<t>" +
            "<'row'<'col-md-5'i><'col-md-7'>p>",
           /* "fnInitComplete": function() {},*/
           
		});
		   //用户动态查询
        $('#doQuery').click(function(event){
        	var _userId=$("#userId").val();
  		  var _type=$("#search select[name='type']").val();
  		  var param={userId:_userId,type:_type/*,"name":name,"phone":phone,"levelId":levelId,"createDate":start,"updateDate":end*/};
  		table.DataTable().search(JSON.stringify(param)).draw();
        //table.DataTable().ajax.reload();
  		});
						
	}

	return {
		init: function() {
			_init();
		}

	};

}();

$(function() {

	orderManage1.init();


});